package com.design.pattern.command;

/**
 * Created by Administrator on 2016/5/18.
 * Invoker 请求者角色
 */
public class Keypad  {

    private Command playCommand;
    private Command rewindCommand;
    private Command stopCommand;

    public void setPlayCommand(Command playCommand) {
        this.playCommand = playCommand;
    }

    public void setRewindCommand(Command rewindCommand) {
        this.rewindCommand = rewindCommand;
    }

    public void setStopCommand(Command stopCommand) {
        this.stopCommand = stopCommand;
    }

    public void play(){
        this.playCommand.execute();
    }

    public void rewind(){
        this.rewindCommand.execute();
    }

    public void stop(){
        this.stopCommand.execute();
    }


}
